<template>
    <header>
        <!-- <img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" /> -->

        <div class="wrapper">
            <!-- <HelloWorld msg="You did it!" /> -->

            <nav>
                <!-- <RouterLink to="/">Home</RouterLink>
                <RouterLink to="/about">About</RouterLink> -->
                <el-container style="margin-top: -32px;margin-left: -50px;">
                    <el-header>
                        <el-menu style="width: 1250px;" class="el-menu-demo" mode="horizontal"
                            background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
                            <span style="margin-left: 20px;">溯源管理</span>
                            <el-button style="margin-left: 900px;margin-top: 12px;" type="danger"
                                @click="router.push('/')">退出登录</el-button>
                        </el-menu>
                    </el-header>
                    <el-container>
                        <el-aside>
                            <el-menu style="margin-left: 20px;height: 500px;" active-text-color="#ffd04b"
                                background-color="#545c64" class="el-menu-vertical-demo" default-active="2"
                                text-color="#fff">
                                <el-sub-menu index="1">
                                    <template #title>
                                        <el-icon>
                                            <location />
                                        </el-icon>
                                        <span>用户管理</span>
                                    </template>
                                    <el-menu-item-group title="Group One">
                                        <el-menu-item index="1-1" @click="router.push('/ShopView')">添砖</el-menu-item>
                                        <el-menu-item index="1-2">item two</el-menu-item>
                                    </el-menu-item-group>
                                    <el-menu-item-group title="Group Two">
                                        <el-menu-item index="1-3">item three</el-menu-item>
                                    </el-menu-item-group>
                                    <el-sub-menu index="1-4">
                                        <template #title>item four</template>
                                        <el-menu-item index="1-4-1">item one</el-menu-item>
                                    </el-sub-menu>
                                </el-sub-menu>
                                <el-sub-menu index="2">
                                    <template #title>
                                        <el-icon>
                                            <location />
                                        </el-icon>
                                        <span>溯源管理</span>
                                    </template>
                                    <el-menu-item-group title="Group One">
                                        <el-menu-item index="2-1">item one</el-menu-item>
                                        <el-menu-item index="2-2">item two</el-menu-item>
                                    </el-menu-item-group>
                                    <el-menu-item-group title="Group Two">
                                        <el-menu-item index="2-3">item three</el-menu-item>
                                    </el-menu-item-group>
                                    <el-sub-menu index="2-4">
                                        <template #title>item four</template>
                                        <el-menu-item index="2-4-1">item one</el-menu-item>
                                    </el-sub-menu>
                                </el-sub-menu>
                            </el-menu>
                        </el-aside>
                    </el-container>
                </el-container>
            </nav>
        </div>
    </header>

    <RouterView />
</template>

<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from '../components/HelloWorld.vue'
import { useCounterStore } from '@/stores/counter';
import { useRouter } from 'vue-router';

const router = useRouter();

const store = useCounterStore();

</script>


<style scoped>
.el-header {
    font-size: 24px;
    text-align: center;
    line-height: 60px;
    /* Aligns text vertically */
}

header {
    line-height: 1.5;
    max-height: 100vh;
}

.logo {
    display: block;
    margin: 0 auto 2rem;
}

nav {
    width: 100%;
    font-size: 12px;
    text-align: center;
    margin-top: 2rem;
}

nav a.router-link-exact-active {
    color: var(--color-text);
}

nav a.router-link-exact-active:hover {
    background-color: transparent;
}

nav a {
    display: inline-block;
    padding: 0 1rem;
    border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
    border: 0;
}

@media (min-width: 1024px) {
    header {
        display: flex;
        place-items: center;
        padding-right: calc(var(--section-gap) / 2);
    }

    .logo {
        margin: 0 2rem 0 0;
    }

    header .wrapper {
        display: flex;
        place-items: flex-start;
        flex-wrap: wrap;
    }

    nav {
        text-align: left;
        margin-left: -1rem;
        font-size: 1rem;

        padding: 1rem 0;
        margin-top: 1rem;
    }
}
</style>
